import tornado.web

class Nav(tornado.web.UIModule):
	def render(self, active):
		pages = self.handler.db.query(
			'SELECT * FROM pages WHERE hidden = 0 AND in_nav = 1 ORDER BY nav_order')
		
		return self.render_string('nav.html', pages=pages, active=active)


class Upload(tornado.web.UIModule):
	def render(self, upload):
		return self.render_string('upload.html', upload=upload)


class Message(tornado.web.UIModule):
	def render(self):
		return self.render_string('message.html', message=self.handler.get_message())